home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / System / MRAC / Ambitus System / ambitus next >
Lisp/Scheme  |  1998-08-11  |  2KB  |  54 lines

  1. ambitus type instrument (l-range h-range) symbols
  2.  
  3. type  - :transpose :invert
  4. range - integer, symbol, pitch or instrument-name
  5.  
  6. This function enables a symbol pattern to be modified to fit into a given range of semitone values - where zero (0) is middle C or C 5 (ex. -5 12) - or a preset instrumental range (ex. violin), or a symbol range (ex. -f m)
  7.  
  8. In the examples below there are instances of two types of range processing on symbols that exceed the given range. These are :transpose and :invert.
  9.  
  10. (setq sym1 '(a b c d e f g h i j k l m n))
  11. (setq sym2 '(a a b g m b -k -q -k e = = s s y w y w ] ] \c \p))
  12.  
  13. (setq sym3 '((a b cd e f gh i j k lm n)
  14.              (a a bg m b -k-q -k e s sy w yw ] ] \c\p)))
  15.  
  16. (setq sym4 '((a b cd = gh i j k = lm n) nil
  17.              (a a bg m = = -k-q -k e s sy w yw \c\p) nil))
  18.  
  19. (ambitus :transpose -5 12 sym1)
  20. => (a b c d e f g h i j k l m b)
  21.  
  22. (ambitus :transpose 'g3 'c5 sym1)
  23. => (a b c d e f g h i j k l m b)
  24.  
  25. (ambitus :transpose '-f 'm sym1)
  26. => (a b c d e f g h i j k l m b)
  27.  
  28. (ambitus :invert -5 12 sym1)
  29. => (a b c d e f g h i j k l m l)
  30.  
  31. In the first example using the type parameter :transpose the symbol n is transposed down an octave to b. In the second example the symbol n is inverted according to its pitch class value to become l.
  32.  
  33. The remaining examples demonstrate how the function is able to operate on any instrument held in the instrument-range library, operate on multiple lists handle chords, and mor complex symbol pattern groupings.
  34.  
  35. (ambitus :transpose 'violin sym2)
  36. => (a a b g m b c -e c e = = s s y w y w ] ] \c \d)
  37.  
  38. (ambitus :invert 'violin sym2)
  39. => (a a b g m b m g m [ = = \i \i \c \a \c \a \g \g \a t)
  40.  
  41. (ambitus :transpose 'viola sym3)
  42. => ((a b cd e f gh i j k lm n) (a a bg m b -k-e -k e s sy w yw ] ] wx))
  43.  
  44. (ambitus :invert 'viola sym3)
  45. => ((a b cd e f gh i j k lm n) (a a bg m b -k-e c q _ _y w yw ] ] wj))
  46.  
  47. (ambitus :transpose 'violin sym4)
  48. => ((a b cd = gh i j k = lm n) nil
  49.     (a a bg m = = c-e c e s sy w yw |cd|) nil)
  50.  
  51. (ambitus :invert 'violin sym4)
  52. => ((a b cd = gh i j k = lm n) nil
  53.     (a a bg m = = \c] \c u \c |ci| \g ig [h) nil)
  54.